A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
1. Field of the Invention
The invention is directed to selecting pixels from a target document image, in which the selected pixels correspond to one of plural color patches on a target document. More particularly, the invention concerns selecting the pixels by successively discarding groups of all pixels for a border of an area of the image that includes pixels corresponding to the color patch until a variance of color values is stabilized for pixels in the area.
2. Description of the Related Art
Due to variations in color devices such as color printers and color scanners, it is sometimes necessary to calibrate the color devices. One method of calibrating a color printer involves printing a series of color patches on a target document and then scanning the target document with a scanner whose color characteristics are known. The color values generated by the scanner for each color patch are used to determine a color measurement for each color patch. The resulting color measurements for the color patches then can be used to calibrate the color printer.
Likewise, a color scanner can be calibrated by scanning a target document which includes color patches that have known colors. Again, the color values generated by the scanner for each color patch are used to determine a color measurement for each color patch. The resulting color measurements for the color patches can be compared to the known colors, and the color scanner can be calibrated accordingly.
In calibration processes like those described above, it is necessary to obtain a color measurement for each of the color patches on the target document. In order to obtain the color measurement for each color patch, the scanned image of the target document is analyzed. In particular, the scanned image includes pixels organized into a rectangular grid. The color values for the pixels for a particular color patch are analyzed so as to determine a color measurement for the color patch.
One problem encountered in obtaining the color measurements is that the target document often is offset, skewed or otherwise distorted. In addition, the edges of color patches can be distorted by bleeding, dithering and anti-aliasing effects. As a result, the location of color patches, and in particular the location of the edges of the color patches, may not be known exactly. Because of these inaccuracies, it is possible for the color values attributed to a color patch to include color values for pixels from a border of the patch or from one or more adjacent color patches. These extraneous color values can lead to an improper color measurement for the color patch, which in turn can result in improper calibration of the scanner or printer.
Moreover, each color patch may include pixels of different colors, such as is produced by dithering or error diffusion. For example, colored and uncolored (white) pixels could be mixed in a single patch so as to produce a light version of the color. Thus, it may be necessary to include color values of such different colors when determining a color measurement for a given color patch. It is therefore not acceptable simply to discard color values which vary within a color patch.
Accordingly, a need exists for a method that determines which color values from scanning a target document actually are for pixels in each particular color patch, and which color values are for pixels outside the color patch. One conventional method is to determine a center of a color patch, and then to use color values for a sub-patch which includes a fixed portion of the color patch. For example, a sub-patch which is a rectangle covering 80% of the actual color patch could be utilized. However, this conventional approach can discard an unacceptably large amount of color values, particularly for a xe2x80x9cgoodxe2x80x9d scan without the foregoing problems, thereby degrading the precision of the color measurement for the color patch.
The invention addresses the foregoing deficiencies by determining a variance of color values for pixels in an approximation of pixels which correspond to a color patch in a target document. The approximation can be obtained based on an expected position of the color patch. Then, groups of all pixels for a border of the approximation are successively discarded, thereby reducing an area of the approximation, until a variance of color values is stabilized for pixels in the approximation.
By virtue of the foregoing, groups of border pixels are interatively discarded from the approximation of the color patch until the variance of the color values for the approximation is stabilized. It has been found that discarding these border pixels results in good color measurements, at least partly because unwanted pixels tend to occur on the edges of a color patch. Thus, once the variance is stabilized, pixels from adjacent color patches are most likely discarded. In addition, because the iterations can stop with a significant non-zero variance, color patches which contain variously colored pixels are accommodated. As a result, more color values for a given color patch tend to be utilized than in conventional systems, while color values for pixels outside of the color patch are reliably discarded.
Accordingly, in one aspect the invention selects pixels from a scanned image of a target document. The target document includes a plurality of color patches. The image includes a rectangular grid of pixels at least some of which correspond to a color patch on the target document. All of the selected pixels correspond to the color patch. The pixels of the image have color values associated therewith.
According to the invention, a position in the image is determined which is expected to correspond to the color patch on the target document. An approximation is selected of pixels which correspond to the color patch at the determined position in the image. Groups of all pixels for a border of the approximation are successively discarded, thereby reducing an area of the approximation. The groups of pixels are successively discarded until a variance of color values is stabilized for pixels in the approximation. If a number of pixels in the approximation falls below a predetermined threshold, failure of the selection of pixels preferably is indicated.
Preferably, each time a group of all pixels for the border of the approximation is discarded, the border has a width of one pixel. The border can run around an entire periphery of the approximation. Alternatively, the border can be selected in turn from the top side, left side, bottom side and right side of the approximation.
Once the variance is stabilized, pixels in the approximation either before or after a most recent border has been discarded can be selected as pixels which all correspond to the color patch. A color measurement for the color patch can be determined from these selected pixels.
According to another aspect of the invention, the pixels for the color patch are selected by first determining a position in the image which is expected to correspond to a color patch on the target document. Then, an approximation of pixels which correspond to the color patch is selected at the determined position in the image. A first variance of color values is determined for the pixels in the selected approximation. A group of all pixels for a border of the approximation is discarded, thereby reducing an area of the approximation. A second variance of color values is determined for the pixels in reduced approximation. The two most recently determined variances are compared. In a case that the comparison indicates that the variance is not stabilized, the process is repeated so as to continue discarding groups of pixels and checking variances. In a case that the variance is stabilized, the pixels in the approximation either before or after a most recent discarding of border pixels are selected as pixels which all correspond to the color patch.
This brief summary has been provided so that the nature of the invention may be understood quickly. A more complete understanding of the invention can be obtained by reference to the following detailed description of the preferred embodiments thereof in connection with the attached drawings.